{{ $name := .Name }}
{{ if eq $name "hole-tabs" }}{{ $name = "hole" }}{{ end }}

{{ if .Golfer }}
<dialog id=settings-dialog>
    <form action=/golfer/settings/save method=post>
        <h2>Page Settings</h2>

        <input name=page type=hidden value="{{ $name }}">
        <input name=path type=hidden value="{{ .Path }}">

        {{ template "settings" . }}

        <menu>
            <!-- Enter submits the first button, we flip the order in CSS -->
            <button class="btn green">Save</button>
            <button class="btn" formaction=/golfer/settings/reset>
                Restore Defaults
            </button>
            <button class="btn red" formmethod=dialog>Cancel</button>
        </menu>
    </form>
</dialog>
{{ end }}
